#! /bin/sh -e

# get F# zip file from Microsoft
wget http://download.microsoft.com/download/B/8/6/B869DF5B-B2C7-4125-8A1E-23CA77235048/fsharp.zip
# wget http://download.microsoft.com/download/1/3/B/13BE2B98-E487-4032-9441-22D4D2F4FAAC/fsharp.zip
unzip fsharp.zip
mv FSharp-2.0.0.0/* fsharp
rmdir FSharp-2.0.0.0
rm fsharp.zip
cd fsharp

# get Mono key and re-sign the F# dll
# this trick will be removed once the following bug is closed:
# https://bugzilla.novell.com/show_bug.cgi?id=615445
wget http://anonsvn.mono-project.com/source/trunk/mcs/class/mono.snk
sn -q -R bin/FSharp.Core.dll mono.snk
rm mono.snk

# make the package
dpkg-buildpackage
# generate the .rpm file from the .deb
alien -cr fsharp_2.0-1_all.deb
